<template>
    <view class="container">
        <view>
            <desc-wrapper :title="title" :desc="desc"></desc-wrapper>
            <z-card title="基本信息">
                <block v-if="resp">
                    <view class="flex-row justify-center">
                        <image :src="resp.image" mode="widthFix" style="width: 50%"></image>
                    </view>
                   <!-- <view class="card-content-item" style="margin-top: 20rpx;">
                        <text class="card-content-label_left">您翻出塔罗第</text>
                        <view class="card-content_right">{{ resp.id }}张牌</view>
                    </view> -->
                    <view class="card-content-item" style="margin-top: 20rpx;">
                        <text class="card-content-label_left">牌名：</text>
                        <view class="card-content_right">
                            {{ resp.牌名 }}
                        </view>
                    </view>
                    <view class="card-content-item">
                        <text class="card-content-label_left">正逆：</text>
                        <view class="card-content_right">
                            {{ resp.正逆 }}
                        </view>
                    </view>
                    <view class="card-content-item">
                        <text class="card-content-label_left">星相：</text>
                        <view class="card-content_right">
                            {{ resp.星相 }}
                        </view>
                    </view>
                    <view class="card-content-item">
                        <text class="card-content-label_left">关键字：</text>
                        <view class="card-content_right">
                            {{ resp.关键字 }}
                        </view>
                    </view>
                    <view class="card-content-item">
                        <text class="card-content-label_left">四要素：</text>
                        <view class="card-content_right">
                            {{ resp.四要素 }}
                        </view>
                    </view>
                    <view class="card-content-item">
                        <text class="card-content-label_left shrink-0">牌面描述：</text>
                        <view class="card-content_right">
                            {{ resp.牌面描述 }}
                        </view>
                    </view>
                </block>
            </z-card>
            <z-card title="解牌含义">
                <block v-if="resp">
                    <view class="card-content-item">
                        <text class="card-content-label_left shrink-0">基本含义：</text>
                        <view class="card-content_right">
                            {{ resp.正位含义.基本含义 }}
                        </view>
                    </view>
                    <view class="card-content-item">
                        <text class="card-content-label_left shrink-0">恋爱婚姻：</text>
                        <view class="card-content_right">
                            {{ resp.正位含义.恋爱婚姻 }}
                        </view>
                    </view>
                    <view class="card-content-item">
                        <text class="card-content-label_left shrink-0">工作学业：</text>
                        <view class="card-content_right">
                            {{ resp.正位含义.工作学业 }}
                        </view>
                    </view>
                    <view class="card-content-item">
                        <text class="card-content-label_left shrink-0">人际财富：</text>
                        <view class="card-content_right">
                            {{ resp.正位含义.人际财富 }}
                        </view>
                    </view>
                    <view class="card-content-item">
                        <text class="card-content-label_left shrink-0">健康生活：</text>
                        <view class="card-content_right">
                            {{ resp.正位含义.健康生活 }}
                        </view>
                    </view>
                    <view class="card-content-item">
                        <text class="card-content-label_left shrink-0">恋爱婚姻：</text>
                        <view class="card-content_right">
                            {{ resp.正位含义.恋爱婚姻 }}
                        </view>
                    </view>
                </block>
            </z-card>
			<view class="bottom-btns" style="transform: translateY(-100%);" @click="todashi">
				<view class="start-btn">
					<text>大师详解</text>
				</view>
			</view>
            <view class="bottom-btns">
                <!-- <view class="start-btn" @click="onClick_1">
          <text class="">开始测算</text>
        </view> -->
                <!-- <view class="contact-btn"></view> -->
            </view>
        </view>
       <!-- <u-tabbar :value="value1" @change="change1" inactive-color="#7C8491" activeColor="#275515" :fixed="true" :placeholder="false" :safeAreaInsetBottom="false">
            <u-tabbar-item v-for="(item, idx) in tabList" :text="item.labelText">
                <image class="u-page__item__slot-icon" slot="active-icon" :src="item.activeIconPath"></image>
                <image class="u-page__item__slot-icon" slot="inactive-icon" :src="item.iconPath"></image>
            </u-tabbar-item>
        </u-tabbar> -->
    </view>
</template>

<script>
export default {
    data() {
        return {
            index: 0,
            title: '一张牌占卜抽牌结果',
            desc: '',
            resp: null,
            value1: 1,
            tabList: [
                {
                    labelText: '首页',
                    url: '/pages/tabbar/home',
                    iconPath: '/static/image/tabbar/tabbar1.png',
                    activeIconPath: '/static/image/tabbar/activetabbar1.png'
                },
                {
                    labelText: '论坛',
                    url: '/pages/tabbar/forum',
                    iconPath: '/static/image/tabbar/tabbar2.png',
                    activeIconPath: '/static/image/tabbar/activetabbar2.png'

                    // activeIconPath: '/static/image/tabbar/activetabbar2.png'
                },
                {
                    labelText: '客服',
                    url: '/pages/tabbar/service',
                    iconPath: '/static/image/tabbar/tabbar3.png',
                    activeIconPath: '/static/image/tabbar/activetabbar3.png'
                },
                {
                    labelText: '我的',
                    url: '/pages/tabbar/mine',
                    iconPath: '/static/image/tabbar/tabbar4@3x.png',
                    activeIconPath: '/static/image/tabbar/activetabbar4@3x.png'
                }
            ]
        }
    },
    methods: {
        onClick_1() {},
        change1(e) {
            console.log(e)
            uni.switchTab({
                url: this.tabList[e].url
            })
        },
		todashi(){
			uni.switchTab({
				url:'/pages/tabbar/service'
			})
		}
    },
    onLoad(opt) {
		const formDataValue = opt.formData;
		console.log(formDataValue, '接收到的值');
        
		const that = this
        let params = JSON.parse(opt.formData);
		//const numericValue = Number(params.formData);
		console.log(params,'parama的值')
        //this.index = params.taluo_id
		//console.log(this.index)
        uni.request({
            url: 'https://cs.appzdm.com:3000/Zhanbu/taluozhanbu',
            method: 'POST',
            header: {
                'Content-Type': 'application/x-www-form-urlencoded'
            },
            data:{ taluo_id: String(params) },
            success: (res) => {
                console.log(res.data.data)
                that.resp = res.data.data
            },
            fail: (error) => {
                console.error('Request Failed:', error)
            }
        })
    }
}
</script>

<style lang="scss"></style>
